(global.webpackJsonp = global.webpackJsonp || []).push([["plugins/mch/shop/shop"], {
  "0150": function(t, i, e) {
      var o = function() {
          var t = this;
          t.$createElement;
          t._self._c
      },
      n = [];
      e.d(i, "a",
      function() {
          return o
      }),
      e.d(i, "b",
      function() {
          return n
      })
  },
  9673 : function(t, i, e) {
      e.r(i);
      var o = e("fe5b"),
      n = e.n(o);
      for (var a in o)"default" !== a &&
      function(t) {
          e.d(i, t,
          function() {
              return o[t]
          })
      } (a);
      i.
  default = n.a
  },
  a23c: function(t, i, e) {},
  c581: function(t, i, e) {
      e.r(i);
      var o = e("0150"),
      n = e("9673");
      for (var a in n)"default" !== a &&
      function(t) {
          e.d(i, t,
          function() {
              return n[t]
          })
      } (a);
      e("ff03");
      var s = e("2877"),
      r = Object(s.a)(n.
  default, o.a, o.b, !1, null, "471628be", null);
      i.
  default = r.exports
  },
  fe5b: function(t, i, e) { (function(t) {
          function o(t, i) {
              var e = Object.keys(t);
              if (Object.getOwnPropertySymbols) {
                  var o = Object.getOwnPropertySymbols(t);
                  i && (o = o.filter(function(i) {
                      return Object.getOwnPropertyDescriptor(t, i).enumerable
                  })),
                  e.push.apply(e, o)
              }
              return e
          }
          function n(t, i, e) {
              return i in t ? Object.defineProperty(t, i, {
                  value: e,
                  enumerable: !0,
                  configurable: !0,
                  writable: !0
              }) : t[i] = e,
              t
          }
          Object.defineProperty(i, "__esModule", {
              value: !0
          }),
          i.
      default = void 0;
          var a = {
              name: "shop",
              components: {
                  appGoodsList: function() {
                      return Promise.all([e.e("common/vendor"), e.e("components/page-component/app-goods-list/app-goods-list")]).then(e.bind(null, "3f73"))
                  }
              },
              computed: function(t) {
                  for (var i = 1; i < arguments.length; i++) {
                      var e = null != arguments[i] ? arguments[i] : {};
                      i % 2 ? o(e, !0).forEach(function(i) {
                          n(t, i, e[i])
                      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : o(e).forEach(function(i) {
                          Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(e, i))
                      })
                  }
                  return t
              } ({},
              (0, e("2f62").mapState)({
                  userInfo: function(t) {
                      return t.user.info
                  }
              })),
              data: function() {
                  return {
                      mch_id: -1,
                      sort: 1,
                      cat_id: 0,
                      sort_type: 0,
                      page: 1,
                      load: !1,
                      args: !1,
                      is_service: 0,
                      detail: null,
                      mch_setting: null,
                      tab: 2,
                      shopKf: !1,
                      coupon_list: [],
                      goods_list: [],
                      fixed: !1,
                      order_preview: this.$api.mch.order_preview,
                      order_submit: this.$api.mch.order_submit
                  }
              },
              onLoad: function(t) {
                  this.$store.dispatch("user/info"),
                  this.mch_id = t.mch_id,
                  this.cat_id = t.cat_id ? t.cat_id: 0,
                  this.loadShop(),
                  this.getGoods(),
                  this.getOption(),
                  this.addVisit()
              },
              onReachBottom: function() {
                  var t = this;
                  if (!t.args && !t.load) {
                      t.load = !0;
                      var i = t.page + 1;
                      t.$request({
                          url: t.$api.mch.goods,
                          data: {
                              page: i,
                              mch_id: t.mch_id,
                              sort: t.sort,
                              sort_type: t.sort_type,
                              mch_status: 2,
                              cat_id: t.cat_id
                          }
                      }).then(function(e) {
                          if (0 === e.code) {
                              var o;
                              o = 5 === t.sort ? t.formatList(t.goods_list, e.data.list) : t.goods_list.concat(e.data.list);
                              var n = [i, 0 === e.data.list.length, o];
                              t.page = n[0],
                              t.args = n[1],
                              t.goods_list = n[2]
                          }
                          t.load = !1
                      })
                  }
              },
              onShareAppMessage: function() {
                  return this.$shareAppMessage({
                      title: this.detail.store.name,
                      path: "/plugins/mch/shop/shop",
                      params: {
                          mch_id: this.mch_id
                      }
                  })
              },
              methods: {
                  navCat: function() {
                      t.navigateTo({
                          url: "/plugins/mch/cat/cat?mch_id=" + this.mch_id
                      })
                  },
                  navigateSummary: function() {
                      t.navigateTo({
                          url: "/plugins/mch/summary/summary?mch_id=" + this.mch_id
                      })
                  },
                  navigateCs: function() {
                      t.navigateTo({
                          url: "/pages/web/web?url=" + this.mch_setting.web_service_url
                      })
                  },
                  getOption: function() {
                      var t = this;
                      t.$request({
                          url: t.$api.mch.setting
                      }).then(function(i) {
                          0 === i.code && (t.is_service = i.data.setting.is_service)
                      })
                  },
                  loadShop: function() {
                      var i = this;
                      i.$showLoading(),
                      i.$request({
                          url: i.$api.mch.detail,
                          data: {
                              id: i.mch_id
                          }
                      }).then(function(e) {
                          if (i.$hideLoading(), 0 === e.code) {
                              var o = [e.data.detail, e.data.mchSetting];
                              i.detail = o[0],
                              i.mch_setting = o[1],
                              t.setNavigationBarTitle({
                                  title: i.detail.store.name
                              })
                          }
                      }).
                      catch(function(t) {
                          i.$hideLoading()
                      })
                  },
                  addVisit: function() {
                      var t = this;
                      t.$request({
                          url: t.$api.mch.visit,
                          method: "POST",
                          data: {
                              mch_id: t.mch_id
                          }
                      }).then(function(t) {})
                  },
                  getGoods: function() {
                      var t = this;
                      t.$showLoading(),
                      t.$request({
                          url: t.$api.mch.goods,
                          data: {
                              page: 1,
                              mch_id: t.mch_id,
                              sort: t.sort,
                              sort_type: t.sort_type,
                              mch_status: 2,
                              cat_id: t.cat_id
                          }
                      }).then(function(i) {
                          t.$hideLoading(),
                          0 === i.code && (t.goods_list = i.data.list)
                      }).
                      catch(function(i) {
                          t.$hideLoading()
                      })
                  },
                  changeStyle: function(t) {
                      3 === this.sort && 3 === t && (this.sort_type = this.sort_type ? 0 : 1);
                      var i = [t, [], 1, !1, 0];
                      this.sort = i[0],
                      this.goods_list = i[1],
                      this.page = i[2],
                      this.args = i[3],
                      this.cat_id = i[4],
                      this.getGoods()
                  },
                  tabChange: function(t) {
                      var i = [t, t, 1, !1, 0];
                      this.sort = i[0],
                      this.tab = i[1],
                      this.page = i[2],
                      this.args = i[3],
                      this.cat_id = i[4],
                      this.getGoods()
                  },
                  onPageScroll: function(t) {
                      var i = 102;
                      2 == this.tab && (i = 160),
                      this.fixed = t.scrollTop >= i
                  },
                  copyInfo: function() {
                      t.setClipboardData({
                          data: this.detail.wechat,
                          success: function() {}
                      })
                  },
                  callPhone: function() {
                      t.makePhoneCall({
                          phoneNumber: this.detail.store.mobile
                      })
                  },
                  openKfModal: function() {
                      this.shopKf = !0
                  },
                  closeKfModal: function() {
                      this.shopKf = !1
                  },
                  formatList: function(t, i) {
                      if (!i.length) return odlArray;
                      var e, o, n = t.pop(),
                      a = i.shift();
                      return n.label === a.label ? (n.goods_list = n.goods_list.concat(a.goods_list), o = n) : (t = t.concat(n), o = a),
                      e = t.concat(o),
                      e = e.concat(i)
                  }
              }
          };
          i.
      default = a
      }).call(this, e("543d").
  default)
  },
  ff03: function(t, i, e) {
      var o = e("a23c");
      e.n(o).a
  }
},
[["4af9", "common/runtime", "common/vendor"]]]);